{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>代理管理</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>商品列表</cite></a>
	</div>
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<form class="layui-form layui-form-pane" action="" method="post">
		<blockquote class="layui-elem-quote">
			<div class="layui-inline">
				<div class="layui-input-inline">
					<input type="text" name="name" placeholder="商品名称" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<div class="layui-input-inline">
					<input type="text" name="agent_name" placeholder="商家名称" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<select name="is_on_sale">
					<option value="0">状态</option>
					<option value="1" {if $is_on_sale=='1' }selected{/if}>上架</option>
					<option value="2" {if $is_on_sale=='2' }selected{/if}>下架</option>
				</select>
			</div>
			<a class="layui-btn search_btn"><i class="fa fa-search"></i> 查询</a>
			<a class="layui-btn layui-btn-status page-btns" href="{:url('status',['table'=>'goods','val'=>1,'id_name'=>'goods_id','field'=>'is_on_sale'])}"><i class="fa fa-check-circle-o"></i> 上架</a>
			<a class="layui-btn layui-btn-danger page-btns" href="{:url('status',['table'=>'goods','val'=>2,'id_name'=>'goods_id','field'=>'is_on_sale'])}"><i class="fa fa-ban"></i> 下架</a>
		</blockquote>
		</form>
		<div class="layui-tab-content">
			<table class="layui-table layui-form">
				<thead>
					<tr>
						<th style="width: 30px;">
							<input type="checkbox" lay-skin="primary" lay-filter="allChoose">
						</th>
						<th class="text-center">标志</th>
                         <th class="text-center">商品编号</th>
                          <th class="text-center">商品名称</th>
                        <th class="text-center">所属店铺</th>
                        <th class="text-center">成本价</th>
                        <th class="text-center">销售价</th>
                        <th class="text-center">库存</th>
                        <th class="text-center">累计销售</th>
                        <th class="text-center">上下架状态</th>
                        <th class="text-center">添加时间</th>
					</tr>
				</thead>
				<tbody>
					<form id="listForm">
						{foreach name="list" item="vo"}
						<tr>
							<td>
								<input type="checkbox" name="ids[]" value="{$vo.goods_id}" class="layui-checkbox checkbox-ids" lay-skin="primary">
							</td>
							<td><img style="width: 40px; height: 40px;" src="{$vo.logo}"/></td>
							<td>{$vo.goods_sn}</td>
							<td>{$vo.goods_name}</td>
							<td>{$vo.agent_name}</td>
							<td>{$vo.cost_price}</td>
							<td>
								{$vo.sale_price}
							</td>
							<td>{$vo.stock}</td>
							<td>{$vo.sales}</td>
							<td>{if $vo.is_on_sale==1}上架{else}下架{/if}</td>
							<td>{$vo.add_time}</td>
						</tr>
						{/foreach}
					</form>
				</tbody>
			</table>
			{$list->render()}
		</div>
	</div>
</div>
{/block}
{block name="js"}
<script>
	var GV = {
		current_controller: "{$controller}/goods"
	};
</script>
{/block}